package com.have.blog.admin.redis;


import com.have.blog.security.bo.OnlineAdmin;
import com.have.blog.model.models.Admin;
import com.have.blog.model.models.ResourceMenu;

import java.util.List;
import java.util.concurrent.TimeUnit;

public interface AdminLoginCacheService {
    String getLoginErrorCount(String ip);
    void setLoginErrorCount(String ip, String count, Integer expiredTime, TimeUnit timeUnit);
    void delLoginErrorCount(String ip);

    void addOnlineAdmin(Admin admin, String token, String tokenUid, String roleName, long expireTime, TimeUnit timeUnit);
    List<OnlineAdmin> getAllOnlineAdmin();
    OnlineAdmin getOnlineAdmin(String token);
    void deleteOnlineAdmin(String token);
    String getToken(String tokenUid);
    void deleteToken(String tokenUid);
    void addResourceList(Integer adminUid, List<ResourceMenu> resourceList, Long expiredSeconds, TimeUnit timeUnit);
    void deleteResourceList(Integer adminUid);
    void deleteAllResourceList();
    List<ResourceMenu> getResourceList(Integer adminUid);
}
